package cn.explink.dop.enums;

import java.util.ArrayList;
import java.util.List;

/**
 * 业务人员 启用枚举
 *
 * @author firefly 2015-2-28 10:38
 *
 */
public enum DeliveryManEnum {

	Enable(1, "在职"), Unable(2, "离职"), DELETE(3, "删除");

	private int value;
	private String text;

	private DeliveryManEnum(int value, String text) {
		this.value = value;
		this.text = text;
	}

	public int getValue() {
		return this.value;
	}

	public String getText() {
		return this.text;
	}

	public static List<DeliveryManEnum> getAllStatus() {
		List<DeliveryManEnum> deliveryManEnum = new ArrayList<DeliveryManEnum>();
		deliveryManEnum.add(Enable);
		deliveryManEnum.add(Unable);
		return deliveryManEnum;
	}

	public static String getTextByValue(int value) {
		List<DeliveryManEnum> allStatus = DeliveryManEnum.getAllStatus();
		for (DeliveryManEnum status : allStatus) {
			if (status.getValue() == value) {
				return status.getText();
			}
		}
		return "";
	}
}
